{extend name="ashippingguide/Public/base" /}
{block name="container"}
<script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
<div class="page-heade">
    <h2 class="title_color text-center">{$data.name}-导购员详细资料<a href="javascript:;" style="float: right;" class="btn btn-sm btn-info" onclick='alert("{:date('Y-m-d H:i:s')}"+" 持续更新");'>导出Excel</a></h2>
</div>"
<form action="" class="form-inline">
    <table class="table-bordered table" style="margin-bottom: 0;margin-top:5px">
        <tr>
            <td class="text-center" style="min-width: 130px;width: 130px">导购员姓名</td>
            <td>{$data.name}</td>
            <td  class="text-center" style="min-width: 130px;width: 130px">工牌号</td>
            <td>{$data.workNumber}</td>
            <td  class="text-center" style="min-width: 130px;width: 130px">经销商名称</td>
            <td>{$data.jxs}</td>
            <td class="text-center" rowspan="4" style="width: 180px">
                <div style="width: 80%;height: 120px" class="form-group text-center">
                    <img id="personPic" alt="个人近照"
                         src="<?php if($data['userPhoto']){echo '/uploads/bx_guide_user/'.$data['userPhoto'];}else{echo '__STATIC__/layout/img/nopic_boy.gif';} ?>"
                         height="130" width="100" /></a>
                </div>
                </div>
            </td>
        </tr>
        <tr>
            <td class="text-center">所属网点分区</td>
            <td>{$data.yq}</td>
            <td class="text-center">所属网点省份</td>
            <td>{$data.ys}</td>
            <td class="text-center">所属网点城市</td>
            <td>{$data.yshi}</td>
        </tr>
        <tr>
            <td class="text-center">主网点标准名称</td>
            <td><a href="/index/net/view/?id={$data.wd_id}">{$data.wd}</a></td>
            <td class="text-center">网点编号</td>
            <td>{$data.wd_no}</td>
            <td class="text-center">系统名称</td>
            <td>{$data.xt}</td>
        </tr>
        <tr>
            <td class="text-center">当前所在网点</td>
            <td colspan="5">{$data['mainNet']}</td>
        </tr>
        <tr>
            <td class="text-center">更多所属网点</td>
            <td colspan="6">{$data['otherNet']}</td>
        </tr>
        <tr>
            <td class="text-center">岗位类型</td>
            <td>{$data['postType']}</td>
            <td class="text-center">入职时间</td>
            <td>{$data['entryDate']}</td>
            <td class="text-center">转正时间</td>
            <td colspan="2">{$data['justDate']}</td>
        </tr>
        <tr>
            <td class="text-center">性别</td>
            <td><?php if($data['sex'] == 0){ echo '男';} else {echo '女';} ?></td>
            <td class="text-center">身份证号码</td>
            <td>{$data.IDNo}</td>
            <td class="text-center">民族</td>
            <td colspan="2">{$data['nation']}</td>
        </tr>
        <tr>
            <td class="text-center">管理费(元/月)</td>
            <td>{$data['manageMoney']}</td>
            <td class="text-center">保险(元/月)</td>
            <td>{$data['safeMoney']}</td>
            <td class="text-center">杂费(元/月)</td>
            <td colspan="2">{$data['otherMoney']}</td>
        </tr>
        <tr>
            <td class="text-center">其他补贴(元/月)</td>
            <td>{$data['otherSubsidyMoney']}</td>
            <td class="text-center">是否签订合同</td>
            <td><?php if($data['signContract'] == 0){ echo '否';} else {echo '是';} ?></td>
            <td class="text-center">促销员类型</td>
            <td colspan="2"><?php if($data['promoters'] == 0){ echo '长期促销员';} else {echo '临时促销员';} ?></td>
        </tr>
        <tr>
            <td class="text-center">手机号</td>
            <td>{$data['phone']}</td>
            <td class="text-center">微信号</td>
            <td>{$data['weixin']}</td>
            <td class="text-center">邮箱</td>
            <td colspan="2">{$data['email']}</td>
        </tr>
        <tr>
            <td class="text-center">所属品牌</td>
            <td>{$data['pinpai']}</td>
            <td class="text-center">所属品类</td>
            <td colspan="4">{$data['pinlei']}</td>
        </tr>
        <tr>
            <td class="text-center">导购等级</td>
            <td>{$data['guideGrade']}</td>
            <td class="text-center">招聘渠道</td>
            <td>{$data['recruitmentChannels']}</td>
            <td class="text-center">招聘推荐人及部门</td>
            <td colspan="2">{$data['referee']}</td>
        </tr>
        <tr>
            <td class="text-center">紧急联系人</td>
            <td>{$data['urgentLinkman']}</td>
            <td class="text-center">紧急联系人电话</td>
            <td>{$data['urgentTel']}</td>
            <td class="text-center">与导购员关系</td>
            <td colspan="2">{$data['guideRelationship']}</td>
        </tr>
        <tr>
            <td class="text-center">开户行</td>
            <td>{$data['openingBank']}</td>
            <td class="text-center">银行账号</td>
            <td>{$data['bankAccount']}</td>
            <td class="text-center">入职申请提报人</td>
            <td colspan="2">{$data['applicant']}</td>
        </tr>
        <tr>
            <td class="text-center">通讯地址</td>
            <td colspan="6">{$data['livingProvince']}-{$data['livingCity']}-{$data['livingCounty']}-{$data['livingAddress']}</td>
        </tr>
        <tr>
            <td class="text-center">户口所在地</td>
            <td colspan="3">{$data['houseProvince']}-{$data['houseCity']}-{$data['houseCounty']}-{$data['houseAddress']}</td>
            <td class="text-center">户口性质</td>
            <td colspan="2"><?php if($data['houseType'] == 0){ echo '农村户口';} else {echo '城市户口';} ?></td>
        </tr>
        <tr>
            <td class="text-center">目前状态</td>
            <td>{$data['nowState']}</td>
            <td class="text-center">出生日期</td>
            <td colspan="4">{$data['birthDate']}</td>
        </tr>
        <tr>
            <td class="text-center">工作照片</td>
            <td style="height: 50px"><img alt="工作照片"
                                          src="<?php if($data['workPhoto']){echo '/uploads/bx_guide_user/'.$data['workPhoto'];}else{echo '__STATIC__/layout/img/nopic_boy.gif';} ?>"
                                          height="130" width="100" /></td>
            <td class="text-center">身份证照片</td>
            <td style="height: 50px"><img alt="身份证照片"
                                          src="<?php if($data['IDPhoto']){echo '/uploads/bx_guide_user/'.$data['IDPhoto'];}else{echo '__STATIC__/layout/img/nopic_boy.gif';} ?>"
                                          height="130" width="100" /></td>
            <td class="text-center">银行照片</td>
            <td style="height: 50px" colspan="2"><img alt="银行照片"
                                                      src="<?php if($data['bankPhoto']){echo '/uploads/bx_guide_user/'.$data['bankPhoto'];}else{echo '__STATIC__/layout/img/nopic_boy.gif';} ?>"
                                                      height="130" width="100" /></td>
        </tr>
        <tr>
            <td class="text-center">备注</td>
            <td colspan="6">{$data['des']}</td>
        </tr>
        <tr>
            <td colspan="7">
                <table class="table-bordered table text-center">
                    <tr>
                        <td>人事类型</td>
                        <td>执行时间</td>
                        <td>原因</td>
                        <td>薪级</td>
                        <td>网点</td>
                        <td>岗位</td>
                    </tr>
                    {volist name="tingType" id="list"}
                    <tr>
                        <td>{$list.tingType}</td>
                        <td>{$list.okDate}</td>
                        <td>{$list.reason}</td>
                        <td>{$list.wd}</td>
                        <td>{$list.postType}</td>
                        <td>{$list.salaryLevel}</td>
                    </tr>
                    {/volist}
                </table>
            </td>
        </tr>
    </table>
</form>
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
    <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">入职记录</a></li>
    <li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">异动记录</a></li>
    <li role="presentation"><a href="#messages" aria-controls="messages" role="tab" data-toggle="tab">在岗检查记录</a></li>
    <li role="presentation"><a href="#settings" aria-controls="settings" role="tab" data-toggle="tab">劳动合同信息</a></li>
</ul>

<!-- Tab panes -->
<div class="tab-content">
    <div role="tabpanel" class="tab-pane fade in active" id="home">
        <table class="table table-bordered text-center">
            <tr>
                <td colspan="7" class="text-left"><a href="javascript:;" class="btn btn-sm btn-info" id="addhistory">新增历史入离职记录</a><span class="lr_5">注意：新增历史入离职记录时，入职日期、离职日期不能超过导购员最新入职日期。</span></td>
            </tr>
            <tr class="info">
                <td>序号</td>
                <td>入职日期</td>
                <td>入职申请表</td>
                <td>离职申请表</td>
                <td>离职日期</td>
                <td>备注</td>
                <td>操作</td>
            </tr>
            {volist name="apple" id="vo"}
            <tr>
                <td>第{$i}次入职</td>
                <td>{$vo.fillinDate}</td>
                <td><a href="{:url('ashippingguide/quitguidep')}?id={$vo.apple_id}">{$vo.no}</a></td>
                <td></td>
                <td></td>
                <td class="text-left">{$vo.theme}</td>
                <td>如需修改导购员最新入离职日期，<br>请到导购员档案管理中修改。</td>
            </tr>
            {/volist}
            {volist name="quit" id="vo1"}
            <tr>
                <td>第{$i}次离职</td>
                <td></td>
                <td></td>
                <td><a href="{:url('ashippingguide/quitguidep')}?id={$vo1.apple_id}">{$vo1.no}</a></td>
                <td>{$vo1.fillinDate}</td>
                <td class="text-left">{$vo1.theme}</td>
                <td>如需修改导购员最新入离职日期，<br>请到导购员档案管理中修改。</td>
            </tr>
            {/volist}
        </table>
    </div>
    <div role="tabpanel" class="tab-pane fade" id="profile">
        <table class="table table-bordered text-center">
            <tr class="info">
                <td>序号</td>
                <td>异动申请编号</td>
                <td>异动生效日期</td>
                <td>异动类型</td>
                <td>异动前</td>
                <td>异动后</td>
            </tr>
            {volist name="accident" id="vo2"}
            <tr>
                <td>{$i}</td>
                <td><a href="{:url('ashippingguide/accidentInfo')}?id={$vo2.user_id}">{$vo2.no}</a></td>
                <td>{$vo2.okDate}</td>
                <td>{$vo2.field}</td>
                <td>{$vo2.oldDes}</td>
                <td>{$vo2.newDes}</td>
            </tr>
            {/volist}
        </table>
    </div>
    <div role="tabpanel" class="tab-pane fade" id="messages">
        <table class="table table-bordered text-center">
            <tr class="info">
                <td>No.</td>
                <td>类型</td>
                <td>汇报时间</td>
                <td>状态</td>
                <td>异常原因</td>
                <td>汇报地址</td>
                <td>备注</td>
                <td>操作</td>
            </tr>
        </table>
    </div>
    <div role="tabpanel" class="tab-pane fade" id="settings" style="">
        <table class="table table-bordered text-center">
            <tr class="info">
                <td>No.</td>
                <td>索引</td>
                <td>合同名称</td>
                <td>乙方名称</td>
                <td>岗位类型</td>
                <td>甲方名称</td>
                <td>乙方所属网点名称</td>
                <td>合同起始日</td>
                <td>合同到期日</td>
                <td>签署次数</td>
                <td>已返回合同</td>
                <td>人员状态</td>
            </tr>
            {volist name="labourContract" id="list"}
            <tr>
                <td>{$i}</td>
                <td>{$list.indexes}</td>
                <td>{$list.contractName}</td>
                <td>{$list.BPartyName}</td>
                <td>{$list.postType}</td>
                <td>{$list.APartyName}</td>
                <td class="text-left"><a href="/index/net/view/?id={$list.mainNet_id}"
                                         class="J_menuItem">{$list.mainNet}</a></td>
                <td>{$list.signDate}</td>
                <td>{$list.endDate}</td>
                <td>{$list.signNum}</td>
                <td>{$list.returnContract}</td>
                <td>{$list.state}</td>
            </tr>
            {/volist}
        </table>
    </div>
</div>

<!--<div class="row-margin-top border-bottom" id="tab_title">-->
    <!--<ul class="nav nav-tabs gray-bg" id="side-menu">-->
        <!--<li role="presentation" class="J_menuItem active"><a href="{:url('guidendetailzl')}">入职记录</a></li>-->
        <!--<li role="presentation" class="J_menuItem"><a href="{:url('guidendetailzl1')}">异动记录</a></li>-->
        <!--<li role="presentation" class="J_menuItem"><a href="{:url('guidendetailzl2')}">在岗检查记录</a></li>-->
        <!--<li role="presentation" class="J_menuItem"><a href="{:url('guidendetailzl3')}">劳动合同信息</a></li>-->
    <!--</ul>-->
<!--</div>-->
<div class="ibox-content" id="addhistoryDiv" style="display: none;">
    <form action="" class="form-inline" method="post" id="form1">
        <table class="table-bordered table">
            <tr>
                <td colspan="2" class="info font-bold" style="font-size:16px">新增历史入离职记录</td>
            </tr>
            <tr>
                <td style="width: 140px">姓名</td>
                <td>{$data.name}</td>
            </tr>
            <tr>
                <input type="hidden" value="{$data['id']}" name="id">
                <td style="width: 140px">入职时间<span class="colorRed">*</span></td>
                <td><input type="text" class="form-control layer-date" name="entryDate" id="start" value="{$data['entryDate']}"></td>
            </tr>
            <tr>
                <td style="width: 140px">离职时间<span class="colorRed">*</span></td>
                <td><input type="text" class="form-control layer-date" name="quitDate" id="end" value="{$data['quitDate']}"></td>
            </tr>
        </table>
    </form>
</div>
<script>
    //日期范围限制
    var start = {
        elem: '#start',
        format: 'YYYY/MM/DD',
        min: laydate.now(), //设定最小日期为当前日期
        max: '2099-06-16 23:59:59', //最大日期
        istime: true,
        istoday: false,
        choose: function (datas) {
            end.min = datas; //开始日选好后，重置结束日的最小日期
            end.start = datas //将结束日的初始值设定为开始日
        }
    };
    var end = {
        elem: '#end',
        format: 'YYYY/MM/DD',
        min: laydate.now(),
        max: '2099-06-16 23:59:59',
        istime: true,
        istoday: false,
        choose: function (datas) {
            start.max = datas; //结束日选好后，重置开始日的最大日期
        }
    };
    laydate(start);
    laydate(end);

    $("#addhistory").click(function(){
        layer.open({
            type: 1,
            title: '新增历史入离职记录',
            area: ['700px', '400px'],
            fixed: false, //不固定
            maxmin: true,
            content: $('#addhistoryDiv'),
            btn:["保存","返回"],
            yes: function (i, o) {
                var param = $('#form1').serialize();
               $.post("{:url('ashippingguide/editDate')}", param, function (data) {
                   if (data.success) {
                           layer.close(i);
                           location.reload()
                   } else {
                       swal('网络错误！请重试')
                   }
               }, 'json')
           }
        });

    })
</script>
{/block}